home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / tcp / amitcp / amitcp-src-22.lha / AmiTCP-2.2 / src / l / inet-handler / interrupt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-17  |  2.0 KB  |  98 lines

  1. /*
  2.  * interrupt.c
  3.  *
  4.  * Author: Tomi Ollila <too@cs.hut.fi>
  5.  *
  6.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  7.  *              All rights reserved.
  8.  *
  9.  * Created: Tue Oct 19 21:27:16 1993 too
  10.  * Last modified: Mon Nov 15 23:21:26 1993 too
  11.  *
  12.  * $Id: interrupt.c,v 1.1 1993/11/17 11:47:44 too Exp $
  13.  *
  14.  * HISTORY
  15.  * $Log: interrupt.c,v $
  16.  * Revision 1.1  1993/11/17  11:47:44  too
  17.  * Initial revision
  18.  *
  19.  * Revision 1.1  1993/11/17  11:47:44  too
  20.  * Initial revision
  21.  *
  22.  * Revision 1.1  1993/10/24  12:50:39  too
  23.  * Initial revision
  24.  *
  25.  */
  26.  
  27. #include <exec/types.h>
  28. #include <exec/lists.h>
  29. #include <exec/ports.h>
  30. #include <exec/execbase.h>
  31.  
  32. #include "global.h"
  33.  
  34. #include <sys/types.h>
  35.  
  36. #include "applport.h"
  37.  
  38. #include "dirindex.h"
  39.  
  40. #define RFI ->
  41.  
  42. #if __GNUC__
  43.  
  44. #define RAF2(funname, type1, arg1, reg1, type2, arg2, reg2) \
  45.   funname(VOID)                \
  46. {                    \
  47.   register type1 reg1 __asm(#reg1); \
  48.   type1 arg1 = reg1;             \
  49.   register type2 reg2 __asm(#reg2); \
  50.   type2 arg2 = reg2;
  51.  
  52. #elif __SASC
  53. #include <proto/exec.h>
  54. #define RAF2(funname,type1, arg1, reg1,type2, arg2, reg2) \
  55.  __asm funname(register __##reg1 type1 arg1,    \
  56.            register __##reg2 type2 arg2)    \
  57. {
  58.  
  59. #else
  60.   #error foo
  61. #endif /* __GNUC__ */
  62.  
  63. /*
  64.  * interrupt handler...
  65.  */
  66. void RAF2(intCode,
  67.       struct ExecBase *,    SysBase,    a6,
  68.       struct ApplPort *,    port,        a1)
  69. #if 0
  70. {
  71. #endif
  72.  
  73. #if __GNUC__
  74.   register struct ApplShared * AS __asm("a5") = port->ap_AS;
  75. #else
  76.   struct ApplShared * AS = port->ap_AS;
  77. #endif  
  78.   int pos = applcbpos;
  79.  
  80.   directIndex(struct ApplPort *, applcbbuf, pos) = port;
  81.   
  82.   pos += sizeof (struct ApplPort *);
  83.   pos &= 0x3f * sizeof (struct ApplPort *);
  84.   applcbpos = pos;
  85. #if __GNUC__
  86.   {
  87.     register struct Task * a1 __asm("a1") = me;
  88.     register ULONG d0 __asm("d0") = applportflag;
  89.     __asm __volatile ("jmp a6@(-0x144)"            /* Signal() */
  90.               : /* no output */
  91.               : /*"r" (a6),*/ "r" (a1), "r" (d0)
  92.               : "a0","a1","d0","d1", "memory");
  93.   }
  94. #else
  95.     Signal(me, applportflag);
  96. #endif
  97. }
  98.